It is known to control a machine having one or more moving portions by a numerical control apparatus (to be referred to as an NC apparatus hereinafter), and to control respective moving portions by one or more control shafts (to be referred to as shafts hereinafter). In a conventional numerical control apparatus (to be referred to as an NC apparatus hereinafter) of this type, pulse distribution to each shaft is performed based on an NC program at predetermined cycles, and a servo motor for each shaft is driven to drive the shaft. On the other hand, check for overtravel of each shaft is performed by checking whether the shaft is moved beyond the overtravel preset value after completion of pulse distribution processing for each cycle.
Since overtravel check is delayed by one cycle of pulse distribution from pulse distribution, a shaft is stopped beyond the overtravel preset value by an amount equal to a product of its feeding speed and a pulse distribution cycle. Therefore, when the pulse distribution cycle is 8 msec and the maximum feeding speed is 10 m/min, the shaft may overrun a maximum of about 1.33 mm (10,000.times.1/60.times.8/1,000).
For this reason, conventionally, a real moving limit position of a machine cannot be set as the overtravel preset value, but a value added with a margin equal to the product of the maximum feeding speed and the pulse distribution cycle described above must be set, resulting in a narrow actual moving range.
However, according to a machine or an apparatus to be controlled by an NC apparatus, the machine must be moved from an end to the other end of a moving range of the machine. For example, when an injection molding machine is controlled by an NC apparatus, the machine must be moved from an end to the other end of the moving range of the machine by JOB feeding during purging or lock up adjustment of a clamp. In such an operation, for the above-mentioned reason, a stop position of the machine is not fixed according to the feeding speed and the distribution processing timing, and the machine cannot be moved in the maximum moving range.